<div style="margin:10px;" align=center>
	<h1>Członkowie Automobilklubu Krakowskiego</h1>

	<%= link_to 'Dodaj osobę', new_admin_member_path %>

	<%= will_paginate @people, :inner_window => 5, :outer_window => 5 %>
	
	<table  width=690 border='1' style="border: solid black 1px; margin:10px;">
		<tr>
				<th>Numer legitymacji</th>
		    <th>Osoba</th>
		    <th>Miasto</th>
		    <th>Telefon</th>
		    <th>E-mail</th>
		    <th>Uwagi</th>
				<th colspan=3>Akcje</th>
		</tr>
	
		<% for member in @members %>
		  <tr>
		  	<td><%=h member.legitimacy_number %></td>
		    <td><%=h member.person.last_name %> <%=h member.person.first_name %></td>
		    <td><%=h member.person.city ? member.person.city.name : '' %></td>
		    <td><%=h member.person.phone %></td>
				<td><%= mail_to member.person.email, member.person.email  %></td>
		    <td><%=h truncate member.person.comment, 20 %></td>
		    <td><%= link_to 'S', admin_member_path(member) %></td>
		    <td><%= link_to 'E', edit_admin_member_path(member) %></td>
		    <td><%= link_to 'D', admin_member_path(member), :confirm => 'Na pewno chcesz usunąć członka AK?', :method => :delete %></td>
		  </tr>
		<% end %>
	</table>
	
	<%= will_paginate @member, :inner_window => 5, :outer_window => 5 %>
	
</div>
